package com.springboot.prac.prac02_draw;

import java.awt.*;

/**
 * 创建画板
 */
public class DrawPictureCanvas extends Canvas {
    // 创建画板中图片对象
    private Image image;

    public void setImage(Image image) {
        this.image = image;
    }

    @Override
    public void paint(Graphics g) {
        g.drawImage(image, 0, 0, null);
    }

    @Override
    public void update(Graphics g) {
        paint(g);
    }
}
